pkgname=firmware-samsung-a3
pkgver=1
pkgrel=1
_name="Samsung Galaxy A3 (2015)"
pkgdesc="Firmware for $_name"
url="https://postmarketos.org"
subpackages="$pkgname-wcnss-nv:wcnss_nv"
arch="aarch64"
license="proprietary"
options="!check !strip !archcheck !tracedeps pmb:cross-native"
source="$pkgname-WCNSS_qcom_wlan_nv.bin.base64::https://pastebin.com/raw/X3t8q7ue"

_fwdir="/lib/firmware/postmarketos"

build() {
	base64 -d $pkgname-WCNSS_qcom_wlan_nv.bin.base64 > WCNSS_qcom_wlan_nv.bin
}

package() {
	# parent package is empty
	mkdir -p "$pkgdir"
}

wcnss_nv() {
	pkgdesc="$_name WiFi/BT firmware configuration"
	replaces="firmware-samsung-a3lte-wcnss firmware-samsung-a3ulte-wcnss"
	install -Dm644 "$srcdir"/WCNSS_qcom_wlan_nv.bin -t "$subpkgdir/$_fwdir"/wlan/prima
}


sha512sums="
54728ddc81b12afe532ce3299a8a6779d2c1553c4e33aa43a8e0e14611fc095a753c33b1edaac90b4c7d104fcdac8929986567560d79023549641d02b8f072e7  firmware-samsung-a3-WCNSS_qcom_wlan_nv.bin.base64
"
